package net.qiqb.core.executing;

import java.util.ArrayList;
import java.util.List;

public class AggregateCommand {
    /**
     * 聚合根命令
     */
    private final CommandWrapper aggregateRootCommand;

    /**
     * 额外命令对象
     */

    private final List<CommandWrapper> extraCommandObjs = new ArrayList<>();


    private Object aggregateRootObj;

    public AggregateCommand(CommandWrapper aggregateRootCommand) {
        this.aggregateRootCommand = aggregateRootCommand;

    }


    public void addExtraCommand(CommandWrapper commandWrapper) {
        this.extraCommandObjs.add(commandWrapper);
    }

    public CommandWrapper getAggregateRootCommand() {
        return aggregateRootCommand;
    }

    public Object getAggregateRootObj() {
        return aggregateRootObj;
    }

    public void setAggregateRootObj(Object aggregateRootObj) {
        this.aggregateRootObj = aggregateRootObj;
    }

    public List<CommandWrapper> getExtraCommandObjs() {
        return extraCommandObjs;
    }
}
